-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Make Grok3 streaming work with OpenAI Compatible #2449
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
|
|
||
| const isGrokXAI = this._isGrokXAI(this.options.openAiBaseUrl) | ||
|
|
||
| const requestOptions: OpenAI.Chat.Completions.ChatCompletionCreateParamsStreaming = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider extracting the logic for constructing streaming options into a helper function to reduce duplication.
fix: update ChatRowContent(user msg in chat windows) background and font size for better styling Add o1-pro to api.ts (RooCodeInc#2433) Add the o1-pro model to the openai section. Sourced model info from: https://platform.openai.com/docs/models/o1-pro Update contributors list (RooCodeInc#2411) docs: update contributors list [skip ci] Co-authored-by: mrubens <[email protected]> Add custom instructions for de (RooCodeInc#2383) v3.11.11 (RooCodeInc#2435) API fixes (RooCodeInc#2438) Changeset version bump (RooCodeInc#2436) * changeset version bump * Update CHANGELOG.md --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Matt Rubens <[email protected]> More sane evals default concurrency + staggered startup (RooCodeInc#2441) Fix gh fork command (RooCodeInc#2442) Add a script to copy eval run results to Turso (RooCodeInc#2452) Fall back on aggressive line number stripping in diffs (RooCodeInc#2453) * Add option for aggressive line number stripping * Fall back on aggressive line number stripping in diffs Make Grok3 streaming work with OpenAI Compatible (RooCodeInc#2449) Update contributors list (RooCodeInc#2434) docs: update contributors list [skip ci] Co-authored-by: mrubens <[email protected]> v3.11.12 (RooCodeInc#2454) Changeset version bump (RooCodeInc#2455) * changeset version bump * Updating CHANGELOG.md format * Update CHANGELOG.md --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: R00-B0T <[email protected]> Co-authored-by: Matt Rubens <[email protected]>
Context
Allow streaming to be used when using Open AI Compatible provider with Grok3 API directly.
Implementation
If x.ai in base_url remove unsupported stream_options.
Screenshots
How to Test
Configure Grok3 API in the Open AI Compatible provider and enable streaming support, observe the 400 error "unsupported option: stream_options".
After fix streaming works with Grok3 as expected.
References
https://docs.x.ai/docs/guides/streaming-response#streaming-response
Important
Enable Grok3 streaming in
OpenAiHandlerby excludingstream_optionsfor x.ai base URLs, with tests added.openai.ts,OpenAiHandlernow excludesstream_optionswhenbase_urlis for x.ai, enabling Grok3 streaming._isGrokXAI()to check if the base URL is for x.ai.openai.test.ts, adds tests for Grok xAI configuration and verifiesstream_optionsexclusion during streaming.This description was created by
for dc3f06c. It will automatically update as commits are pushed.